<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-light-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">路灯编号：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="nid" id="nid" placeholder="请输入路灯编号"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">环境温度：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="atemperature" id="atemperature" placeholder="请输入当前环境温度"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">风速：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="windspeed" id="windspeed" placeholder="请输入风速">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工作电流：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="current" id="current" placeholder="请输入当前工作电流">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工作电压：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="voltage" id="voltage"placeholder="请输入当前工作电压">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">亮灯时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="time" name="tstart" id="tstart"placeholder="请输入每日路灯亮起时间">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">熄灯时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="time" name="tdown" id="tdown"placeholder="请输入每日路灯熄灭时间">
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "iot/light";

    $("#form-light-add").validate({
        rules:{
            xxxx:{
                required:true,
            },
        }
    });
    //弹窗
    /*if(nid= ) {
    function alertError(content) {

        // 弹出提示
        layer .alert(content,{
            icon: $.modal.icon("fail"),
            title: "系统提示",
            btn: ['确认'],
            btnclass: ['btn btn-primary'],
        });
    }
    $.modal.alert("操作失败，插入数据与现有数据重复")*/

    /* 错误提示
			alertError: function(content) {
				$.modal.alert(content, modal_status.FAIL);
			},*/


    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-light-add').serialize());
        }
    }


</script>
</body>
</html>
